#@embedLayout()


#define content()

<form id="formId" method="post">
    <input type="hidden" name="equipment.equ_id" id="equId" value="#(equipment.equId??)">
    <table class="table table-bordered">
        <tr>
            <td style="padding-top:15px;">厂商:</td>
            <td>
                <input id="venId" name="equipment.ven_id" class="easyui-combobox" style="width: 250px;" data-options="
                    valueField: 'ven_id',
                    textField: 'vendor_alias',
                    editable:false,
                    required:true,
                    url: '#(ctx)/equipment/findVendorList'" value="#(equipment.ven_id??)">
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">设备型号:</td>
            <td><input type="text" id="equModel" name="equipment.equ_model" class="easyui-textbox"
                       data-options="required:true,validType:{length:[1,128]}"
                       value="#(equipment.equ_model??)">
            </td>
        </tr>
    </table>
</form>

#end


#define css()


#end


#define js()

<script type="text/javascript">
    function datagrid_save(opr_type) {
        var url = '';
        if (opr_type == 'add') {
            url = contextRootPath + '/equipment/save';
        } else {
            url = contextRootPath + '/equipment/update';
        }

        $('#formId').form('submit', {
            url: url,
            onSubmit: function () {
                var flag = $(this).form('enableValidation').form('validate');
                if (flag) {
                    showProcess(true, '温馨提示', '正在提交数据...');
                }
                return flag;
            },
            success: function (data) {
                showProcess(false);
                var params = {};
                params.element = _datagrid;
                params.data = data;
                resultCallback(params);
            },
            onLoadError: function () {
                showProcess(false);
                $.messager.alert('温馨提示', '由于网络或服务器太忙，提交失败，请重试！');
            }
        });
    }

</script>

#end


